<!DOCTYPE html>
<html>
<meta charset="utf-8">
<link href="/css/layui.css" rel="stylesheet">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<div class="form-group">
								<label class="col-sm-2 control-label">图片：</label>
								<div class="col-sm-4">
									<!--<input id="picturl" name="picturl" class="form-control" type="text">-->
									<button type="button" class="layui-btn" id="test1">上传图片</button>
								</div>
								<div class="col-sm-6">
									<!--预览图片-->
									<input id="picturl" name="picturl" class="form-control" type="hidden">
									<img class="layui-upload-img" id="demo1">
									<!--提示上传信息-->
									<p id="demoText"></p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">产品编号：</label>
								<div class="col-sm-4">
									<input id="sku" name="sku" class="form-control" type="text">
								</div>
								<label class="col-sm-2 control-label">状态：</label>
								<div class="col-sm-4">
								<!--	<input id="status" name="status" class="form-control" type="text">-->
									<select data-placeholder="--选择状态--" name="status" id="status"
											class="form-control chosen-select" tabindex="2" required>
										<option value="">--选择状态--</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">产品名称：</label>
								<div class="col-sm-10">
									<input id="name" name="name" class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">品牌：</label>
								<div class="col-sm-4">
									<input id="proBrand" name="proBrand" class="form-control" value="0" type="text">
								</div>
								<label class="col-sm-2 control-label">采购价：</label>
								<div class="col-sm-4">
									<input id="purPrice" name="purPrice" class="form-control" value="0" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">总库存：</label>
								<div class="col-sm-4">
									<input id="allQty" name="allQty" class="form-control" value="0" type="text">
								</div>
								<label class="col-sm-2 control-label">总出库数量：</label>
								<div class="col-sm-4">
									<input id="allOutqty" name="allOutqty" class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">产品型号：</label>
								<div class="col-sm-4">
									<input id="proModel" name="proModel" class="form-control" type="text">
								</div>
								<label class="col-sm-2 control-label">产品产地：</label>
								<div class="col-sm-4">
									<input id="picOrigin" name="picOrigin" class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">产品规格：</label>
								<div class="col-sm-10">
									<textarea id="proSpec" name="proSpec" class="form-control"></textarea>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">备注：</label>
								<div class="col-sm-10">
									<textarea id="remarks" name="remarks" class="form-control"></textarea>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
	</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/appjs/pro/product/add.js">
	</script>
	<script src="/js/layui.js"></script>
	<script type="text/javascript">
		layui.use('upload', function () {
			var upload = layui.upload;
			//执行实例
			var uploadInst = upload.render({
				elem: '#test1', //绑定元素
				url: '/common/sysFile/upload', //上传接口
				size: 1000,
				accept: 'file',
				before: function(obj){
					//预读本地文件示例，不支持ie8
					obj.preview(function(index, file, result){
						$('#demo1').attr('src', result); //图片链接（base64）
					});
				},
				done: function (r) {
					//console.log(r);
					//alert(r.fileName);
					//console.log(r.fileName);
					$("#picturl").val(r.fileName);
					layer.msg(r.msg);
					// app.getData();
				},
				error: function (r) {
					layer.msg(r.msg);
				}
			});
		});
	</script>
</body>
</html>
